import { isActiveEnum } from './common';
import { PaginationParams } from './api-common';
import { File } from './file';
import { Category } from './category';
import { ContentTypeEnum } from '@/constants/index';
import { Agent } from './agent';



// 内容实体类型
export interface Content {
  id: string;
  title: string;
  content: string;
  summary?: string;
  coverId: string;
  agent?: Agent;
  viewCount: number;
  favoritesCount?: number;
  isBanner: boolean;
  type: ContentTypeEnum;
  agentId?: string;
  createdAt: string;
  updatedAt: string;
  categories: Category[];
  cover?: File;
  url?: string;
}

// 创建内容请求类型
export interface CreateContentRequest {
  title: string;
  content: string;
  summary?: string;
  order?: number;
  isActive?: isActiveEnum;
  type: number;
  isBanner: number;
  coverId: string;
  url?: string; // 可选站点地址
}

// 更新内容请求类型
export interface UpdateContentRequest extends Partial<CreateContentRequest> {
  id: string;
}

// 内容列表查询参数
export interface ContentListParams extends PaginationParams {
  title?: string;
  isActive?: isActiveEnum;
  type?: number;
  isBanner?: number;
}

// 内容详情查询参数
export interface ContentDetailParams {
  id: string;
}

// 删除内容请求参数
export interface DeleteContentParams {
  id: string;
}

// 收藏实体类型
export interface Favorite {
  id: string;
  contentId: string;
  createdAt: string;
  content: {
    type: number;
    title: string;
    description: string;
    slug: string;
    icon?: string;
    cover?: string;
  };
}